using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BlazorSodDbManager.Models;

namespace BlazorSodDbManager.Services
{
    public interface IDatabaseService
    {
        Task<bool> TestConnectionAsync(DatabaseConnection connection);
        Task<List<string>> GetDatabasesAsync(DatabaseConnection connection);
        Task<List<TableInfo>> GetTablesAsync(DatabaseConnection connection);
        Task<TableInfo> GetTableInfoAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<QueryResult> ExecuteQueryAsync(DatabaseConnection connection, string query);
        Task<QueryResult> ExecuteNonQueryAsync(DatabaseConnection connection, string query);
        Task<List<string>> GetStoredProceduresAsync(DatabaseConnection connection);
        Task<List<string>> GetViewsAsync(DatabaseConnection connection);
        Task<List<string>> GetFunctionsAsync(DatabaseConnection connection);
        Task<string> GenerateCreateTableScriptAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<string> GenerateInsertScriptAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<string> GenerateUpdateScriptAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<string> GenerateDeleteScriptAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<string> GenerateSelectScriptAsync(DatabaseConnection connection, string tableName, string? schema = null);
        Task<QueryResult> ExecuteQueryWithPagingAsync(DatabaseConnection connection, string tableName, string? schema = null, int page = 1, int pageSize = 20);
    }
} 